import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedstate from 'vuex-persistedstate'
import user from '@/store/modules/user'
import targs from '@/store/modules/targs'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    user,targs
  },
  plugins:[
    createPersistedstate({
      //存储方式 localStorage、sessionStorage、cookies
      storage: window.sessionStorage,
      //存储在localStoreger中的KEY
      key:'sailencoding-store',
      //要对那些模块进行持久化存储
      paths:['user','targs']
      // paths:[]
    })
  ]
})
